<template>
  <div class="pie-echart"><HyEchart :options="option"></HyEchart></div>
</template>

<script setup lang="ts">
import HyEchart from '@/base-ui/HyEchart/hy-echart.vue';
import type { IDataType } from './types';
import { computed } from 'vue';
const props = defineProps<{
  pieData: IDataType[];
}>();
const option = computed(() => {
  return {
    title: {
      text: '',
      subtext: '',
      left: ''
    },
    tooltip: {
      trigger: 'item'
    },
    legend: {
      left: 'left'
    },
    series: [
      {
        name: '访问来源',
        type: 'pie',
        radius: '50%',
        data: props.pieData,
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
        }
      }
    ]
  };
});
</script>

<style scoped></style>
